package com.example.kam.mymediapalyer;

import jcifs.smb.SmbFile;

/**
 * Created by kam on 2017/2/12.
 */

public class CheckRootThread extends Thread{

    private CallBack mCallBack;
    private String mUrl;

    CheckRootThread(CallBack callBack,String url){
        mCallBack = callBack;
        mUrl = url;
    }

    interface CallBack{
        void callFiles( SmbFile [] files );
    }

    @Override
    public void run() {
        super.run();
        try {

            SmbFile root = new SmbFile(mUrl);
            SmbFile [] files = root.listFiles();
            if(mCallBack != null){
                mCallBack.callFiles(files);
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
